﻿@namespace Blazorise
@inherits BaseDraggableComponent
<tr @ref="@ElementRef" id="@ElementId" class="@ClassNames" style="@StyleNames" @onclick="@OnClickHandler"
    draggable="@DraggableString"
    @ondragend="@OnDragEndHandler"
    @ondragend:preventDefault="@DragEndPreventDefault"
    @ondragenter="@OnDragEnterHandler"
    @ondragenter:preventDefault="@DragEnterPreventDefault"
    @ondragleave="@OnDragLeaveHandler"
    @ondragleave:preventDefault="@DragLeavePreventDefault"
    @ondragstart="@OnDragStartHandler"
    @ondragstart:preventDefault="@DragStartPreventDefault"
    @ondrop="@OnDropHandler"
    @ondrop:preventDefault="@DropPreventDefault"
    @oncontextmenu="@OnContextMenuHandler"
    @oncontextmenu:preventDefault="@ContextMenuPreventDefault"
    @attributes="@Attributes">
    @for ( int i = 0; i < IndentTableCells; i++ )
    {
        <td class="@RowIndentCellClassBuilder.Class">
            @if ( IndentTableCellTemplate is not null )
            {
                @IndentTableCellTemplate(i)
            }
        </td>
    }
    <td class="@RowCellClassBuilder.Class" colspan="@ColumnSpan">
        @if ( Toggleable )
        {
            @if ( Expanded )
            {
                <Icon Name="IconName.ChevronUp" Padding="Blazorise.Padding.Is3.FromEnd" />
            }
            else
            {
                <Icon Name="IconName.ChevronDown" Padding="Blazorise.Padding.Is3.FromEnd" />
            }
        }
        <span>
            @if ( TitleTemplate is not null )
            {
                @TitleTemplate
            }
            else
            {
                @Title
            }
        </span>
    </td>
</tr>
@if ( Expanded )
{
    @ChildContent
}